package controller;

import java.awt.Point;

import utils.PlayerSides;

/**
 * Interface used to check for hazards in game. Hazards are unsafe moves, Check or Checkmate
 */
public interface KingThreat {

	/**
	 * Checks if opponent pieces have a path that reaches currently attacked King.
	 * If there is at least one path, King is threatened and check is declared.
	 * @param currPlayerSide- indicates currently playing player  
	 * @return True if attacked King is threatened, False if not
	 */	
	public boolean isCheck(PlayerSides.Sides currPlayerSide);
	
	/**
	 * Gets move's details and checks if given move results in the friendly King
	 * being threatened. If making a move threats the friendly King, the move is not safe
	 * @param srcPosition- source position
	 * @param destPosition- destination position
	 * @param currPlayerSide- indicates currently playing player
	 * @return True if move is not safe, False if move is safe
	 */
	public boolean moveNotSafe(Point srcPosition, Point destPosition, PlayerSides.Sides currPlayerSide);
	
	/**
	 * Declares Stalemate if game is not in check and no safe move can be done by the attacked player.
	 * Returns True if Stalemate is declared, False if not
	 * @param currPlayerSide- indicates currently playing player
	 * @return True if Stalemate, False if not
	 */
	public boolean isStalemate(PlayerSides.Sides currPlayerSide);
	
	/**
	 * Declares Checkmate if game is in Check and no safe move can be done.
	 * Returns True if Checkmate is declared, False if not	 * 
	 * @param currPlayerSide- indicates currently playing player
	 * @return True if Checkmate, False if not
	 */
	public boolean isCheckmate(PlayerSides.Sides currPlayerSide);
}